<template>
  <div>
    <header>
      <i class="el-icon-arrow-left" @click="$router.go(-1)"></i>
      <div>我的收藏</div>
      <i></i>
    </header>
    <van-card
      v-for="(item, i) in collectList"
      :key="i"
      :price="item.prices"
      :desc="item.desc"
      :title="item.title"
      :thumb="item.img"
    />
  </div>
</template>

<script>
import Vue from 'vue';
import { Card } from 'vant';

Vue.use(Card);
import { getcollectByShopId } from "../../api/collect";
export default {
  data() {
    return {
      collectList: [],
    };
  },
  mounted() {
    getcollectByShopId(this.$store.state.user.userid).then((res) => {
     this.collectList=res
    });
  },
};
</script>

<style scoped>
header {
  height: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.22rem;
  box-sizing: border-box;
  background-color: #ffffff;
  margin-bottom: 0.2rem;
}

header i {
  flex: 1;
  font-size: 0.48rem;
}
header div {
  flex: 1;
  font-size: 0.32rem;
  font-weight: bold;
  text-align: center;
}
</style>
